package com.spa.infrastructure.service.sms;

import com.spa.infrastructure.common.CacheConstants;
import com.spa.infrastructure.enums.dict.base.RequestSourceEnum;
import com.spa.infrastructure.util.StringUtils;
import org.springframework.stereotype.Service;

import javax.validation.constraints.NotNull;

/**
 * 生成存储验证码key
 */
@Service
public class GenerateSmsCodeKey {

    public String generateSmsCodeKey(@NotNull String phone, String scene) {
        return scene + "_" + CacheConstants.CAPTCHA_SMS_CODE_KEY + StringUtils.nvl(phone, "");
    }
}
